package com.example.demo.service.impls;

import com.example.demo.domain.TeacherEntity;
import com.example.demo.mapper.TeacherMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class TeacherService {
    @Autowired
    private TeacherMapper mapper;

    public List<TeacherEntity>  queryList()
    {
        return  mapper.queryList();
    }

    public TeacherEntity getById(int id){
        return  mapper.getById(id);
    }

    public boolean insert(TeacherEntity entity){
        return  mapper.insert(entity)>0;
    }

    public boolean update(TeacherEntity entity){
        return  mapper.update(entity)>0;
    }

    public boolean delete(TeacherEntity entity){
        return  mapper.deleteByEntity(entity)>0;
    }

    public boolean delete(int id){
        return  mapper.delete(id)>0;
    }
}
